home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / bingo2.zip / BINGO2.SC < prev    next >
Text File  |  1991-09-16  |  2KB  |  40 lines

  1.  
  2. PROC PercentComplete.u(prompt.a,current.s,total.s)
  3.        ;prompt.a                   prompt
  4.        ;current.s                  iteration currently being processed
  5.        ;total.s                    total iterations to complete task,
  6.        ;                           for example NRECORDS("ANSWER")
  7. PRIVATE lenprompt.s,              ;length of prompt, but minimum of 29
  8.         lentotal.s                ;total length (length of prompt + 21)
  9.  
  10. lenprompt.s = MAX(LEN(prompt.a),29)
  11. lentotal.s = lenprompt.s +21
  12.  
  13. IF current.s = 1 THEN             ;do this first time thru only
  14.   PAINTCANVAS ATTRIBUTE 8         ;shadow
  15.   12,INT(((80-lentotal.s)/2)+1),15,INT(((80-lentotal.s)/2)+lentotal.s+3)
  16.   STYLE ATTRIBUTE 31              ;rest of display white on blue
  17.   @11,INT(((80-lentotal.s)/2)-2)??"╔═",FILL("═",lentotal.s),"═╗"
  18.   @12,INT(((80-lentotal.s)/2)-2)??"║ ",prompt.a,"...",
  19.                    SPACES(lenprompt.s-LEN(prompt.a)+3),
  20.                    FORMAT("w4,ar",current.s/total.s*100)," % Complete ║"
  21.   @13,INT(((80-lentotal.s)/2)-2)??"║ ",
  22.                    FILL("█",ROUND(current.s/total.s*lentotal.s,0)),
  23.                    FILL("▒",lentotal.s-ROUND(current.s/total.s*lentotal.s,0))," ║"
  24.   @14,INT(((80-lentotal.s)/2)-2)??"╚═",FILL("═",lentotal.s),"═╝"
  25.   STYLE                          ;return style to normal
  26. ELSE                             ;only do changes after the first time thru
  27.   STYLE ATTRIBUTE 31             ;white on blue
  28.   @12,INT(((80-lentotal.s)/2)+lenprompt.s+6)??FORMAT("w4,ar",current.s/total.s*100)
  29.   @13,INT((80-lentotal.s)/2)??FILL("█",ROUND(current.s/total.s*lentotal.s,0))
  30.   STYLE                          ;return style to normal
  31. ENDIF
  32.  
  33. ENDPROC
  34. PLAY "Whiz3"
  35. ;FOR n FROM 1 TO 175               ;sample this in a FOR loop
  36. ;  PercentComplete.u("Demo Display",n,175)
  37. ;  SLEEP 100
  38. ;ENDFOR                            ;What do you think?
  39.  
  40.